/**
 * Created with CLion.
 * Description:
 * User: loong
 * Date: 2020-11-11
 * Time: 22:54
 */
#ifndef CODSEEGMENT_MYDIALOG_H
#define CODSEEGMENT_MYDIALOG_H

#include <QtWidgets>

class FirstWorker
        : public QObject
{
Q_OBJECT
public:
    FirstWorker();

    ~FirstWorker();

signals:
    void SignalNum(const int _num);
    void SignalFinish();

public slots:

    void SlotWork1();
};

class SecondWorker
        : public QObject
{
Q_OBJECT
public:
    SecondWorker();

    ~SecondWorker();

signals:
    void SignalNum(const int _num);
    void SignalFinish();

public slots:

    void SlotWork2();
};

class MyDialog
        : public QDialog
{
Q_OBJECT
public:
    MyDialog();

    ~MyDialog();

public slots:

    void MainThread();
    void SlotLabel1(const int _num);
    void SlotLabel2(const int _num);
    void SlotFinished();
private:
    void InitUi();

    void InitEvent();

private:
    QPushButton *btn1;
    QPushButton *btn2;

    QLabel *label1;
    QLabel *label2;

    FirstWorker *first_worker_;
    SecondWorker *second_worker_;
};

#endif //CODSEEGMENT_MYDIALOG_H
